/**
 * Created with SublimeText3 
 * @Author:      Chenweihan
 * @DateTime:    2018-06-01 13:49:04
 * @Description: Description
 */
import globalMixin from "@/common/global-mixin"

var uploadMixin = {
    
    mixins: [globalMixin],

    methods: {

	    uploadHandleView (item) {
            this.openImgUrl = item.value;
            this.openImg = true;
        },
        uploadHandleRemove (item) {
            item.value = '';
        },
        uploadHandleError(error, file) {
        	console.log('uploadHandleError');
        },
        uploadHandleSuccess (res, file) {
        	console.log('uploadHandleSuccess');
            //let url = 'https://o5wwk8baw.qnssl.com/7eb99afb9d5f317c912f08b5212fd69a/avatar';
            //this.uploadHandleSuccessCallback ? this.uploadHandleSuccessCallback(res) : ''; 
        },
        uploadHandleFormatError (file) {
            this.$Modal.warning({
                title: 'The file format is incorrect',
                content: 'File format of ' + file.name + ' is incorrect, please select jpg or png.'
            });
        },
        uploadHandleMaxSize (file) {
            this.$Modal.warning({
                title: 'Exceeding file size limit',
                content: 'File  ' + file.name + ' is too large, no more than 2M.'
            });
        },
        uploadHandleBeforeUpload (file) {
            console.log('uploadHandleBeforeUpload',file);
        }
    }

}

export default uploadMixin;